home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / GFXFX2.ZIP / COPPER1.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  1KB  |  60 lines

  1.  
  2. program copper; { COPPER1.PAS }
  3. { Assembler version of a very simple general copper, by Bas van Gaalen }
  4. uses u_vga,u_kb;
  5. const
  6.   pal:array[0..3*28-1] of byte=(
  7.     4,2,2,8,4,4,12,6,6,16,8,8,20,10,10,24,12,12,28,14,14,32,16,16,36,18,18,
  8.     40,20,20,44,22,22,48,24,24,52,26,26,52,26,26,56,28,28,56,28,28,60,30,
  9.     30,60,30,30,60,30,30,63,33,33,63,33,33,63,33,33,63,33,33,63,33,33,60,
  10.     30,30,56,28,28,52,26,26,48,24,24);
  11.  
  12. procedure copperbars(var colors; lines:word; count:byte); assembler;
  13. asm
  14.   cli
  15.   cld
  16.   push ds
  17.   mov ah,0
  18.   mov dh,3
  19.  @l0:
  20.   call vretrace
  21.   mov bh,1
  22.   mov di,[lines]
  23.  @l1:
  24.   mov bl,bh
  25.   inc bh
  26.   lds si,[colors]
  27.  @l2:
  28.   mov dl,0c8h
  29.   mov al,ah
  30.   out dx,al
  31.   inc dx
  32.   outsb
  33.   outsb
  34.   mov dl,0dah      { horizontal retrace }
  35.  @hor1:
  36.   in al,dx
  37.   test al,1
  38.   jnz @hor1
  39.  @hor2:
  40.   in al,dx
  41.   test al,1
  42.   jz @hor2
  43.   mov dl,0c9h
  44.   outsb
  45.   dec di
  46.   jz @out
  47.   dec bl
  48.   jnz @l2
  49.   jmp @l1
  50.  @out:
  51.   dec count
  52.   jnz @l0
  53.   pop ds
  54.   sti
  55. end;
  56.  
  57. begin
  58.   repeat copperbars(pal,380,8); until keypressed;
  59. end.
  60.